/**********************************************************************************
* CLASS
*		BookFlash
*
* DESCRIPTION
* 		Flash manipulate function set:
*			- setSize
*			- setQuality
*			- setDisplay
*		Common function set:
*			- genDomObj (Use by Genesis for create image by using dom.)
*			- loadDefault (For loading default value.)
*
* REVISION HISTORY
*		Revision 1.0 2008/09/08 Atthaboon S.
*		First Release
*
**********************************************************************************/
var BookFlash = Class.create({

	/****************************************************
	* FUNCTION
	*		initialize
	*
	* DESCRIPTION
	* 		initialize the Genesis object.
	*
	* ARGUMENTS
	*		src					: 	Flash source
	*		position_x		   	:	Flash position of x at north left Genesis corner.
	*		position_y 	   	   	:	Flash position of y at north left Genesis corner.
	*
	****************************************************/
  	initialize: function(src,position_x,position_y)
  	{
  		this.domObj = new Element('embed', { 'src':src,'style':'position:absolute; left:'+position_x+'px;top:'+position_y+'px;'});
  		$(this.domObj).setAttribute('width','300px');
  		$(this.domObj).setAttribute('height','300px');
  		$(this.domObj).setAttribute('quality','high');
  	},
  	
  	/****************************************************
	* FUNCTION 
	*		getDomObj
	*
	* DESCRIPTION
	* 		Use by Genesis for get image dom Component.
	*
	* ARGUMENTS
	*
	****************************************************/
	getDomObj : function()
	{
		return this.domObj;
	},
	
	/****************************************************
	* FUNCTION 
	*		setPosition
	*
	* DESCRIPTION
	* 		Set Flash position.
	*
	* ARGUMENTS
	*		position_x		   	:	position x in px.
	*		position_y 	   	   	:	position y in px.
	*
	****************************************************/
	setPosition : function(position_x,position_y)
	{	
		$(this.domObj).setStyle({
		  	left: position_x+'px',
		  	top: position_y+'px'
		});
	},
	
	/****************************************************
	* FUNCTION 
	*		setDisplay
	*
	* DESCRIPTION
	* 		Set Display or hidden.
	*
	* ARGUMENTS
	*		display		   		:	true  if display
	*							:	false if hidden
	*
	****************************************************/
	setDisplay : function(display)
	{	
		$(this.domObj).setAttribute('hidden',display);
	},
	
	/****************************************************
	* FUNCTION 
	*		setSize
	*
	* DESCRIPTION
	* 		Set Flash size.
	*
	* ARGUMENTS
	*		width		   	:	width in px.
	*		height 	   	   	:	height in px.
	*
	****************************************************/
	setSize : function(width,height)
	{	
		$(this.domObj).setStyle({
		  	width: width+'px',
		  	height: height+'px'
		});
	},
	
	/****************************************************
	* FUNCTION 
	*		setQuality
	*
	* DESCRIPTION
	* 		Set Flash Quality.
	*
	* ARGUMENTS
	*		quality		   	:	0 low
	*							1 high
	*
	****************************************************/
	setQuality : function(quality)
	{	
		if(quality == 0)
		{
			$(this.domObj).setAttribute('quality','low');
		}
		else
		{
			$(this.domObj).setAttribute('quality','high');
		}
	}
});


  	